import Vue from 'vue'
import Router from 'vue-router'
import Default from '@/layout/default'
import Index from '@/page/index'
import goodsList from '@/page/goodsList'
import ChangeCity from '@/page/changecity'
import My from '@/page/my'
import productDeatil from '@/page/productdeatil'
import blank from '@/layout/blank'
import login from '@/page/login'
import register from '@/page/register'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'default',
      component: Default,
      redirect: '/index',
      children: [{
        path: 's/:name',
        name: 'goods',
        component: goodsList
      },
      {
        path: '/index',
        name: 'index',
        component: Index
      },
      {
        path: '/changecity',
        name: 'changeCity',
        component: ChangeCity
      },
      {
        path: '/my',
        name: 'my',
        component: My
      }, {
        path: '/productdeatil',
        name: 'productDeatil',
        component: productDeatil
      }]
    }, {
      path: '/blank',
      name: 'blank',
      component: blank,
      children: [{
        path: 'login',
        name: 'login',
        component: login
      },
      {
        path: 'register',
        name: 'register',
        component: register
      }]
    }
  ],
  mode: 'history'
})
